package com.redis.demo.cnntroller;

import com.redis.demo.server.RedisClientTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/redis")
public class RedisTestController {

    @Resource
    RedisClientTemplate redisClientTemplate;

    @GetMapping(value = "/testSet")
    public Object testSet() {
        redisClientTemplate.setToRedis("Frank", "Frank测试redis");
        System.out.println(redisClientTemplate.getRedis("Frank"));
        return null;
    }
}
